package com.atguigu.gulimall.member.service;

import com.atguigu.gulimall.member.exception.PhoneExsitException;
import com.atguigu.gulimall.member.exception.UsernameExistException;
import com.atguigu.gulimall.member.vo.MemberLoginVo;
import com.atguigu.gulimall.member.vo.MemberRegistVo;
import com.atguigu.gulimall.member.vo.SocialUser;
import com.baomidou.mybatisplus.extension.service.IService;
import com.atguigu.common.utils.PageUtils;
import com.atguigu.gulimall.member.entity.MemberEntity;

import java.util.Map;

/**
 * 会员
 *
 * @author syh
 * @email syh794996@163.com
 * @date 2022-06-06 22:55:39
 */
public interface MemberService extends IService<MemberEntity> {

    PageUtils queryPage(Map<String, Object> params);

    /**
     * 会员注册
     *
     * @param vo
     */
    void regist(MemberRegistVo vo);

    /**
     * 检查邮箱是否唯一
     *
     * @param phone
     * @return
     */
    void checkPhoneUnique(String phone) throws PhoneExsitException;

    ;

    /**
     * 检查用户名是否唯一
     *
     * @param userName
     * @return
     */
    void checkUserNameUnique(String userName) throws UsernameExistException;

    /**
     * 用户登录
     *
     * @param vo
     * @return
     */
    MemberEntity login(MemberLoginVo vo);

    /**
     * 社交用户登录
     *
     * @param socialUser
     * @return
     */
    MemberEntity login(SocialUser socialUser) throws Exception;
}

